package com.ty.zls;

import org.junit.Test;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Base64;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
//@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
      //  Context appContext = InstrumentationRegistry.getTargetContext();

        //assertEquals("com.ty.zls", appContext.getPackageName());
    }

    public static void main(String[] args) {
        String a = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB" +
                "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEB" +
                "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAT6A0oDASIA" +
                "AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA" +
                "AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3" +
                "    ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm" +
                "    p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA" +
                "    AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx" +
                "    BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK" +
                "    U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3" +
                "    uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDeMjhD" +
                "    B27e4yR6d8evXPPGTW+2OF8j0x7d2HqOvPfOc9fmNaB+bzZtnp9Dy/Xr7E/hnJ5qkIUI879Me74H" +
                "    Xvg9cnOMjls/64H8Xk6XHlo8Z/5aE4/M56n6fh35NWrCHbvk/wCehXvx1cen+yPzPJNRz2+0o6En" +
                "    8+xJHfjr/LJGM0wS/umjj/2c5Hu3r7bSPqcjIFBth/in8v8A3IWDEIWOz99+PYFhkZPfI/XBySaY" +
                "    jyNnjyfxHPLdcH0xj6nknIpIlljy7tsT8OvzexPY+vY8gAl4kV87F878v9rHQexxn35yck/e/wBc" +
                "    5RY8uE5/dZ6ZwPrjo3ufz70eTGQdhx07e7Dkbu+B79O3LM3z/wBz9G/+JpE2sx3vs4xkA+re/sR+" +
                "    XPHOn73/AKef+Tmn1iX8svuX+QyK5A3IbLg4xKYvQkdMng7f1PPrexuz8vT2z64/ib9fU8nnNSJi" +
                "    GYnnof1IPHuP6e9aUD43L24IP4tn35O3H484yazOunO65oNqztqlfXn6arWze/VapopS7I8/N/46" +
                "    fVh2P078cckDNSWxWYH58429ueS/PU9ccZJwMckVZcK+fl7/AN5vVv8AH3478cxwRLGT8voAdx55" +
                "    ceh4/wAD6nNf7P8A3v8AymMtFosH95+QIz97/PQnkADkmlR12N+8z+DerdeoGO2e+M4GKjLQfUfi" +
                "    ehbk8+mMD1Lc+oAgQ+W57fTq+O/PXPtkdRk1z+wh3l96/wDkTt5F3f4f5DEJyRJJ9OD/AHiOo74x" +
                "    9ck4yOTfDz+8/Q+rD2/xznk4yI8J/eP5f/WpT5H8+uf8/Wj2EO8vvX/yIci7v8P8iWXDRE/QfrJn" +
                "    9earSLudP/r9yw9f9n69OTzl9v8A61/oP/alTWyv5Uvfpk5939ffH6jOTzymRReLy3V/Tp17HnGf" +
                "    w6+/fOHmHy1ln+g/VgTnHfbxn0bqRy+VvMkiT/8AUclufqcHg88kE45LDL5nmWvXGB6dC/v3yOfr" +
                "    3GD0HOSIytGefTHB9c89f/re9HkLIsnPt3B6tnj8Bz6AnJJNQp8kZ79Mfgcc/wA/6ik+1Rrk7/T/" +
                "    ANmxjJPoenPXqTk17CHeX3r/AORO3kXd/h/kSW+nosEibv068sc9eOox7cE5LGqwsNqH97684927" +
                "    bsj257gjJ3E3Ibh2Qkjp05HYsD247fn1JDEzySbbY4HOR39C+e2cH9Mjk5Iqf9o/rkF+8/rlMoRT" +
                "    K33c9Ox9XHHzHrnPr04OaiX7MCwds46EFv5Z/ME/Q1b3vzibf6/L15bnjH692PGQcwBYGYl1z055" +
                "    GcFuuT7n1/h6k1UcPjE3zOT0srRn3/wLp8wwi0nvu+r6cnn5/lduyGgGNT9mbOMYwB2Z+uc49Rn6" +
                "    cc4kCmRZftH+s+jer4xg46f1zk4qwkbRqfKXjsQQcYJ7H15Hf8McOCLIsu8Zbj1OMHjocdD9PXJG" +
                "    aS+sXd+S13ba++m3S3fW5hX+OV+bb5/FU/l6f0zNxP5ZeFctFx1xgAn39Scn3Hah1m+zF3IWTv1b" +
                "    u2OcnHr1/ix/DkpvYMzxfMmR6nu35DgEY9/Q1oYDQrJKNycZ5I7sAOf93p159Rmuip9atLmvvG97" +
                "    2tedv7u9vnfrzHB9WT05ml6ab9lN27/8EzbO1UebJKcEY5wx5yR0JIOefp1zxwTjy/3mNyAj93kj" +
                "    qWA79+vfvkkjIvu0jZ8v+Q+gPGcfQfic81Eqi7ypB6rzkereh+vBBz7fM1Z0qmJpt2cVe1nF6/aW" +
                "    zt0+erTva76eVd39/wCt7r7yCyuNySLjOcd8DGW7npnb3z3PXGQxfNL8npn5veTp16+/Q45PNPii" +
                "    KMQHyen+ox3bPJHoD684HbmS5hVYz/D+ZzgsPXjH82PBAzSo/Vqt/e2srpP+9um7vbS11dvVWbGQ" +
                "    xLblZC7xqRjnr1Jz3PUAd+/JyDTxEhGA5znpt5xzzkj/AGTx/kxLaluNoI+rDPJ+vpnn+ZGZ4onG" +
                "    4h5BGfcc4J9Tk9T06g9jUzp4XdpdrySWzb/ma17emrvouX5+qVvteV+vfvq22yOBIo45ePT/AJbE" +
                "    YG5vU/l77hzzUMUR/ePGPk47tzy2e/sOp655G1xVtIV8o8+nYerY/Qjj2HNUyssfmJmTZ+B7sM9P" +
                "    b35J5IBNX7OH8q/r5l/VJd6f/gC/+RLREkkZR/8ADu3r142/QcZPNMS1RYjn6Z9OW+vZe3c9yKj8" +
                "    l9v3z5fT9enX17frUiSfuj/Pn1fA6d+CT7kHpk5Elbym/uSfkKhEb7js8zHH82469+2Qe3JJFbCR" +
                "    SbSEuIz78+pxxn0HH4c/xMeRJu3/AGiPpjPOP/Qv06+9dBHOvP7l/wDJGebW53N8s35n/Go/IufX" +
                "    9T/8TWsPtO5v3kf8PPP9Dx+J+lRDz9kv+r7fTq36f3ffdQdGG3f+Bf8ApRnw2sy8Z+vGf73PX/Z/" +
                "    XkkinmGYE+2Px5IHGe+08dfqOTZ3XSxcex/9D9vr+mSeahEkzbP892HrnnB46jJ54Y1y1vi/7d/9" +
                "    uNpbv0X/AKVUFMUyIfY9emeW7fh9Mt61VVbpZHT/AHcnn1I9vT88jJwSdgeY23/POWx3Pfr7kYJJ" +
                "    NVJ9/nt07dOvV/8A63tjPbdRh/in/hX/AKVUCnvL0/8AbhVtpuiyfhs926Zz+n+0cHmn/ZvlzvH1" +
                "    2++PTd+GfxxzVxIAVPzemODwAXHr3wfXqOcimeX7/p/9eub22L7r7qf+ZfNHv+DIIGlBIZNvqOhP" +
                "    JAxg8Y4J68E5IxzY8tXQlxknp1BPLDPBwOP1255qwHhfKocjuMEDqfb6HqTyR2yYRDKenOOhOPf3" +
                "    P6n068V30Z3/AIsWmrXW103NdV/dWny5m7ycUKfLz3dpWWrula9S1rq+r1+8rhdrSpGfQfq/v3xz" +
                "    yce+TmaJRgpH6gZPTknpz2x69x1BoRd7N3wfwPJ5PPTA6fUdub8Shd0aegyfofTPP1JHPY1xkFNY" +
                "    XYnzPk9PTqff069+mcjFPjsbXkfl69W989AevPQZGBm7UHyf3B+f/wBagCmbSJWJSPpjuvZn9W9h" +
                "    n3z121fw3lZx+o+vr+n6010Rm+/jy+OPq4Hc+56k4+vEvmfu+3+T6Z/Hr04zn5q5ORd3+H+R0FOB" +
                "CWkIPp268npz6j+fUg5u1Vijw0o/56nt9Se+fT9R3BNTGPrg/gfqw54/T13c96sCmE";
        a = a.trim().replaceAll(" ","");

        byte[] decode = Base64.getDecoder().decode(a);
        try {
            File file = new File("d:/a.bmp");
            file.createNewFile();
            FileOutputStream os = new FileOutputStream(file);
            os.write(decode);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
